<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../../views/common/taglibs.jsp"%>
  <div id="u30" class="ax_default shape">
                <div id="u30_div" class=""></div>
                <!-- Unnamed () -->
                <div id="u31" class="text" style="visibility: visible;">
                  <p><span>
                  	商品管理
        			</span></p>
                </div>
  </div>
  
  <div class="add" align="right">
  <input class="btAdd" name="" value="发布商品" type="button" 
  		onclick="doActionNoParAndCbk('core', '${appServer}/back/item/gotoPublishItemPage.htm?memberName=${item.memberName}');" />
  </div>
  <div id="u30_div" class=""><br/></div>
  
  <div class="search">
	    <form id="itemListFrm" name="itemListFrm" action="${appServer}/back/item/getItemList.htm" method="post" onsubmit="return false;">
		    <table>
				<c:if test="${msg!=null}">
        		<tr>
			    	<td class="tc">
	        			<h2>${msg}</h2>
	        		</td>
				</tr>
  				</c:if>
  				<c:if test="${errorMsg!=null}">
        		<tr>
			    	<td class="tc">
	        			<h2><font color="#FF0000">${errorMsg}</font></h2>
	        		</td>
				</tr>
  				</c:if>
				<tr>
			        <td>
			      	<th>
			      		商品描述：
			      	</th>
			      	<td>
			      		<input type="text" class="fl" name="itemDesc" value="${item.itemDesc}"/>
			      	</td>
			        <td>
			      	<th>
			      		商品编码：
			      	</th>
			      	<td>
			      		<input type="text" class="fl" name="itemCode" value="${item.itemCode}"/>
			      	</td>
			      	<th>
			      		供应商账号：
			      	</th>
			      	<td>
			      		<input type="text" class="fl" name="memberName" value="${item.memberName}"/>
			      	</td>
					<td class="tc"><input class="btSearch" name="" type="button" onclick="searchItemSubmit();" /></td>
				</tr>
		    </table>
	    </form>
  </div>

  <div class="tabtxet" id="listGameWind">
    <table class="tablist" cellspacing="0" cellpadding="0">
      <tr class="tabTop">
        <td colspan="17">
        	<div class="title">
        	商品列表
        	(共<strong>${page.totalCounts}</strong>条)</div>
        </td>
      </tr>
      <tr>
        <th>图片</th>
        <th>商品描述</th>
		<th>受众</th>
        <th>零售价</th>
        <th>结算价</th>
        <th>库存</th>
        <th>商品编码</th>
		<th>商品编码图</th>
        <th>类目</th>
        <th>品牌</th>
        <th>状态</th>
        <th>最后操作日期</th>
        <th>供应商</th>
        <th>操作</th>
      </tr>
      <c:forEach items="${itemList}" var="itemTemp" varStatus="status">
	      <tr>
	        <td>
	        <c:if test="${itemTemp.pic!=null}">
	        <img src="${itemTemp.pic}" alt="商品图片" height="auto" width="50px"/>
	        </c:if>
	        </td>
	        <td>${itemTemp.itemDesc}</td>
			<td>
	        <c:if test="${itemTemp.feature==null || itemTemp.feature=='10'}">通用</c:if>
			<c:if test="${itemTemp.feature!=null && itemTemp.feature=='0'}">女</c:if>
	        <c:if test="${itemTemp.feature!=null && itemTemp.feature=='1'}">男</c:if>
			</td>
	        <td>${itemTemp.priceCurno}&nbsp;${itemTemp.referencePriceDisplay}</td>
	        <td>${itemTemp.priceCurno}&nbsp;${itemTemp.priceDisplay}</td>
	        <td>${itemTemp.stock}</td>
	        <td>${itemTemp.itemCode}<br>
	        	<a href="javascript:doActionNoCallback('core', '${appServer}/back/item/gotoEditItemCodePage.htm?id=${itemTemp.id}&itemDesc=${itemTemp.itemDesc}&itemCode=${itemTemp.itemCode}&itemCodePic=${itemTemp.itemCodePic}&itemCodeOrigin=${itemTemp.itemCode}', itemEditBackParam);">
		        编辑</a>
	        </td>
	        <td>
			<c:if test="${itemTemp.itemCodePic!=null}">
	        <img src="${itemTemp.itemCodePic}" alt="商品编码图" height="auto" width="50px"/>
	        </c:if>
			</td>
	        <td>${itemTemp.categoryFullTitle}</td>
	        <td>${itemTemp.brandTitle}</td>
	        <td>
	        <c:if test="${itemTemp.status=='-1'}">冻结</c:if>
	        <c:if test="${itemTemp.status=='0'}">用户下架</c:if>
	        <c:if test="${itemTemp.status=='1'}">生效</c:if>
	        </td>
	        <td><fmt:formatDate value="${itemTemp.gmtModified}" type="both"/></td>
	        <td>${itemTemp.memberName}</td>
	        <td width="70">
		        <c:if test="${itemTemp.status=='-1' || itemTemp.status=='0' }">
		        <a href="javascript:doActionNoCallback('core', '${appServer}/back/item/resumeItem.htm?id=${itemTemp.id}&pageNO=${page.pageNum}', itemListParamNoPage);">
		        启用</a>&nbsp;&nbsp;
		        </c:if>
		        <c:if test="${itemTemp.status=='1'}">
		        <a href="javascript:doActionNoCallback('core', '${appServer}/back/item/downItem.htm?id=${itemTemp.id}&pageNO=${page.pageNum}', itemListParamNoPage);">
		        冻结</a>&nbsp;&nbsp;
		        </c:if>
		        <a href="javascript:doActionNoCallback('core', '${appServer}/back/item/gotoUpdateItemPage.htm?id=${itemTemp.id}&itemCodeOrigin=${itemTemp.itemCode}', itemEditBackParam);">
		        编辑</a>&nbsp;&nbsp;
		        <a href="#" onclick="popUpdateTagsForItemDiv('${itemTemp.id}');">改标签</a>
	        </td>
	      </tr>
      </c:forEach>
      <tr>
      	<td colspan="17">
	      	共${page.totalPages}页 
	      	第${page.pageNum}页 
	      	<c:if test="${!page.showFirst}">首页</c:if>
	      	<c:if test="${page.showFirst}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/item/getItemList.htm?pageNO=1', itemListParamNoPage);">首页</a></c:if>
	      	<c:if test="${!page.showPrevious}">上一页</c:if>
	      	<c:if test="${page.showPrevious}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/item/getItemList.htm?pageNO=${page.pageNum-1}', itemListParamNoPage);">上一页</a></c:if>
	      	<c:if test="${!page.showNext}">下一页</c:if>
	      	<c:if test="${page.showNext}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/item/getItemList.htm?pageNO=${page.pageNum+1}', itemListParamNoPage);">下一页</a></c:if>
	      	<c:if test="${!page.showLast}">尾页</c:if>
	      	<c:if test="${page.showLast}"><a href="#" onclick="doActionNoCallback('core', '${appServer}/back/item/getItemList.htm?pageNO=${page.totalPages}', itemListParamNoPage);">尾页</a></c:if>
      	</td>
      </tr>
    </table>
  </div>
	
	<div id="itemPopWindow"></div>
	<script type="text/javascript">
	    itemListParamNoPage = {'itemDesc' : '${item.itemDesc}', 'itemCode' : '${item.itemCode}', 'memberName' : '${item.memberName}'};
	    itemEditBackParam = {'itemDescBack' : '${item.itemDesc}', 'itemCodeBack' : '${item.itemCode}', 'memberNameBack' : '${item.memberName}', 'itemListPageNum' : '${page.pageNum}'};
    </script>